import request from "@/utils/request"
import axios from "axios";
export default {
  queryAllCarNo(){
    return request({
      url:`/ReportCenter/queryAllCarNo`,
      method: "get",
    })
  },
  //查询所有接口
  queryAllReportList(){
    axios.defaults.baseURL=process.env.BASE_API
    return[
      this.queryReportListByAccidentRecord(),
      this.queryReportListByFess(),
      this.queryReportListByMaintainRecord(),
      this.queryReportListByInsuranceRecord(),
      this.queryReportListByPeccancyRecord(),
      this.queryReportListByRefuelingRecord(),
    ]
  },
  queryReportListByAccidentRecord(){
    return axios({
      url:"/accident-record/reportList",
      method:"get",
      })
  },
  queryReportListByFess(){
    return axios({
      url:"/fees/table",
      method:"get",
    })
  },
  queryReportListByMaintainRecord(){
    return axios({
      url:"/MaintainRecord/reportList",
      method:"get",
    })
  },
  queryReportListByInsuranceRecord(){
    return axios({
      url:"/insurance-record/reportList",
      method:"get",
    })
  },

  queryReportListByPeccancyRecord(){
    return axios({
      url:"/peccancy-record/reportList",
      method:"get",
    })
  },

  queryReportListByRefuelingRecord(){
    return axios({
      url:"/refueling-record/reportList",
      method:"get",
    })
  },

  //根据id查所有接口
  queryReportByCarId(carId){
    axios.defaults.baseURL= process.env.BASE_API
    return [
      this.queryReportFoFessByCarId(carId),
      this.queryReportFoAccidentRecordByCarId(carId),
      this.queryReportFoMaintainRecordByCarId(carId),
      this.queryReportFoInsuranceRecordByCarId(carId),
      this.queryReportFoPeccancyRecordByCarId(carId),
      this.queryReportFoRefuelingRecordByCarId(carId),
    ]
  },
  queryReportFoFessByCarId(carId){
   return  axios({
      url:`/fees/tableByCarId/${carId}`,
      method:"get",
    })
  },
  queryReportFoAccidentRecordByCarId(carId){
   return  axios({
      url:`/accident-record/queryReportByCarId/${carId}`,
      method:"get",
    })
  },
  queryReportFoMaintainRecordByCarId(carId){
   return  axios({
      url:`/MaintainRecord/queryReportByCarId/${carId}`,
      method:"get",
    })
  },
  queryReportFoInsuranceRecordByCarId(carId){
   return  axios({
      url:`/insurance-record/queryReportByCarId/${carId}`,
      method:"get",
    })
  },
  queryReportFoPeccancyRecordByCarId(carId){
   return  axios({
      url:`/peccancy-record/queryReportByCarId/${carId}`,
      method:"get",
    })
  },
  queryReportFoRefuelingRecordByCarId(carId){
   return  axios({
      url:`/refueling-record/queryReportByCarId/${carId}`,
      method:"get",
    })
  },
}
